package com.xyy.saas.payment.manage.cores.enums;

/**
 *
 */
public enum ResultCodeEnum {

    /**
     * 成功
     */
    SUCCESS("1000", "success",  ""),
    /**
     * 默认错误
     */
    DEFAULT_ERROR("2000", "default_error",  "【系统错误(2000)】"),
    /**
     * 系统繁忙
     */
    SYSTEM_BUSY_ERROR("2001", "system_busy",  "【系统繁忙】"),
    /**
     * APP ID 不可用
     */
    APP_UNAVAILABLE("2002", "app_unavailable",  ""),
    /**
     * 系统权限不足
     */
    SYSTEM_NOT_ALLOW("2003", "system_not_allow",  ""),
    /**
     * 渠道未创建对应用户
     */
    CHANNEL_UNAVAILABLE("2004", "app_unavailable",  ""),
    /**
     * 请求已被处理
     */
    REQUEST_PROCESSED("2005", "request_processed",  ""),
    /**
     * 加密失败
     */
    ENCRYPT_ERROR("2006", "encrypt_error",  ""),
    /**
     * 解密失败
     */
    DECRYPT_ERROR("2007", "decrypt_error",  "解密数据异常"),

    ACCOUNT_CHANNEL_ERROR("2008", "account_channel_error", ""),

    PAY_MODE_ERROR("2009", "pay_mode_error", "支付方式错误"),

    CREATE_ACCOUNT_ERROR("2010", "insert_account_table_error", ""),
    /**
     * 认证失败
     */
    LOGIN_ERROR("2011", "login_error", "登录认证失败！"),
    /**
     * 不支持的方法
     */
    UN_SUPPORT_METHOD("2012", "un_support_method", "不支持的方法"),
    //----------------------------------------------------------
    /**
     * 数据库异常
     */
    DATABASE_ERROR("2013", "database_error", "数据库异常"),

    /**
     * 参数错误
     */
    PARAM_ERROR("3001", "param_error",  "【参数错误(3001)】"),
    /**
     * 签名错误
     */
    SIGN_ERROR("3002", "sign_error",  "【系统错误(3002)】"),
    /**
     * 订单不存在
     */
    TRADE_NOT_EXIT_ERROR("3003", "trade_not_exit_error",  ""),
    /**
     * 订单可退金额不足
     */
    REFUND_MONEY_NOT_ENOUGH("3004", "refund_amount_not_enough",  ""),
    /**
     * 订单可退佣金不足
     */
    REFUND_COMMISSION_NOT_ENOUGH("3005", "refund_commission_not_enough",  ""),
    /**
     * 参数内回调地址不合法
     */
    CALLBACK_URL_UN_LEGAL("3006", "call_back_url_un_legal",  "参数内回调地址不合法"),
    /**
     * 用户不存在,或未初始化
     */
    USER_NOT_FOUND("3007", "user_not_found",  "【用户不存在】"),
    /**
     * 订单未支付
     */
    ORDER_NOT_PAID_ERROR("3008", "order_not_paid_error",  "订单未支付"),
    /**
     * 订单已结算或已开始结算
     */
    ORDER_SETTLED_ERROR("3009", "order_settled_error",  "订单已结算或已开始结算"),
    /**
     * 用户余额不足
     */
    USER_BALANCE_NOT_ENOUGH("3010", "user_balance_not_enough",  "用户余额不足"),
    /**
     * 提现已到次数或由于其他原因无法提现
     */
    USER_CANNOT_WITHDRAW("3011", "user_cannot_withdraw",  "提现已到次数或由于其他原因无法提现"),
    /**
     * 订单可退分润不足
     */
    ORDER_REFUND_ROYALTY_NOT_ENOUGH("3012", "order_refund_royalty_not_enough",  "订单可退分润不足"),
    /**
     * 订单可分润金额不足
     */
    ORDER_ROYALTY_AMOUNT_NOT_ENOUGH("3013", "order_royalty_amount_not_enough",  "订单可分润金额不足"),
    /**
     * 订单暂时不能退款
     */
    ORDER_CANNOT_REFUND_TEMPORARY("3014", "order_cannot_refund_temporary",  "订单暂时不能退款"),
    /**
     * 用户已经存在，请勿重复创建
     */
    ACCOUNT_IS_EXIST("3015", "accountId_is_already_exist",  "用户已经存在，请勿重复创建"),
    /**
     * 订单已经支付，请勿重复支付
     */
    ORDER_ALREADY_PAY("3016", "order_is_already_pay",  "您的订单已支付完成，请勿重新支付"),
    /**
     * 订单操作中
     */
    ORDER_IN_PROCESS("3017", "order_in_process",  "您的订单正在处理中, 请稍后"),
    /**
     * 订单金额 错误
     */
    ORDER_AMOUNT_ERROR("3018", "order_amount_error",  "您的金额有误, 请查证后再进行"),
    /**
     * 订单过期
     */
    ORDER_TIME_EXPIRE("3019", "order_is_time_expire",  "您的订单已超时，请重新支付"),
    /**
     * 收银台业务配置支付渠道异常
     */
    CASHIER_PAY_CHANNEL_ERROR("3020", "cashier_pay_channel_error", "暂时不支持您选的支付机构，请重新选择"),

    PARAM_SUBJECT_ERROR("3021", "param_subject_or_body_error", ""),

    PARAM_AMOUNT_ERROR("3022", "param_amount_error", ""),

    ORDER_CANNOT_REFUND("3023", "order_cannot_refund", "订单已超过退款期限"),

    ORDER_NOT_CLEARING("3024","order_not_clearing","订单未清分"),

    ORDER_REFUND_NOT_FINISH("3025", "order_refund_not_finish", "订单退款不是最终状态"),
    /**
     * 第三方用户不存在
     */
    THIRD_USER_ID_NOT_EXIST("3026", "third_user_id_not_exist", "第三方账户不存在"),

    ORDER_CLOSED_ERROR("3027", "order_closed_error", "订单关闭失败"),

    ORDER_CLOSED_CHANNNEL_ERROR("3028", "order_closed_channel_error", "订单渠道无法关闭"),

    ORDER_ALREADY_CLOSED("3029", "order_already_closed", "订单已经关闭"),

    ORDER_NOT_EXIST("3030", "order_not_exist", "订单号不存在，请查证后再进行"),

    /**
     * 订单已经支付，无法关闭
     */
    ORDER_ALREADY_PAY_NO_CLOSED("3031", "order_is_already_pay_no_closed",  "您的订单已支付完成，无法关闭"),

    ORDER_ALREADY_CLOSED_PROCCESSING("3032", "order_already_closed_processing", "请勿重复发起订单关闭"),


    /**
     * 用户信息不存在
     */
    USER_INFO_NOT_FOUND("3033", "user_info_not_found",  "【用户信息不存在】"),
    /**
     * 微信开户意愿申请单
     */
    WX_APPLYMENT_NOT_FOUND("3034", "wx_applyment_not_found",  "开户意愿申请单不存在"),
    WX_APPLYMENT_CANNOT_AGAIN_APPLY("3034", "wx_applyment_cannot_again_apply",  "无法重新申请!"),
    WX_APPLYMENT_CANCEL_FAIL("3034", "wx_applyment_cancel_fail",  "撤销申请单失败!"),
    WX_APPLYMENT_FAIL("3035", "wx_applyment_fail",  "申请开户意愿申请单失败!"),

    //
    PAY_CHANNEL_ERROR("3036", "pay_channel_error",  "渠道错误!"),
    PAY_SCENE_ERROR("3037", "pay_scene_error",  "支付场景错误!"),
    // ----------------------------------------------------

    /**
     * 交易单处理失败
     */
    CALLBACK_ERROR("4000", "callback_error",  ""),
    /**
     * 第三方接口连接异常
     */
    CHANNEL_CONNECT_ERROR("4001", "channel_connect_error",  "【系统错误(4001)】"),
    /**
     * 第三方接口需要的参数缺失
     */
    THIRD_PARAM_ERROR("4002", "missing_parameters",  "【系统错误(4002)】"),
    /**
     * 当日在途金额不足
     */
    CHANNEL_TODAY_MONEY_NOT_ENOUGH("4003", "channel_today_money_not_enough",  ""),
    /**
     * 用户上传图片过大
     */
    PIC_LARGE_ERROR("4004", "pic_too_large",  "【图片过大，请按图片建议尺寸上传】"),

    /**
     * 验证码过期
     */
    ACTIVE_CODE_ERROR("4005", "【验证码过期】",  "【验证码过期】"),
    /**
    // ----------------------------------------------------


    /**
     * 结算用户列表为空
     */
    SETTLE_ACCOUNT_LIST("5000", "settle_account_list_zero",  ""),


    // ----------------------------------------------------


    /**
     * 获取userId错误
     */
    GET_USER_ID_ERROR("6000", "can_not_get_user_id",  ""),
    /**
     * 获取第三方结算账号错误
     */
    GET_THIRD_SETTLE_ERROR("6001", "can_not_get_settle_id",  ""),
    /**
     * 获取用户状态错误
     */
    GET_USER_STATE_ERROR("6002", "can_not_find_user_state", ""),
    /**
     * 图片格式错误
     */
    PIC_FORMAT_ERROR("7001", "pic_format_error", ""),
    /**
     * 防止重复点击
     */
    NOT_CONTINUOUS_CLICK("7002", "continuous_click", "【请勿重复操作】"),
    /**
     * 商户入驻请按顺序执行
     */
    PLEASE_FOLLOW_ORDER("7003", "please_follow_order", "【系统繁忙，请稍候再试】"),
    /**
     * 商户已经入驻，请勿重复申请
     */
    MERCHANT_ALREADY_EXIT("7004", "merchant_already_exit", "【商户已经入驻，请勿重复申请】"),


    // 开户相关
    OPEN_PAY_ALREADY_OPEN("9001", "OPEN_PAY_ALREADY_OPEN", "【功能已开通，请勿重复操作】"),

    /**
     * 冻结
     */
    FROZEN_SETTLEMENT_ERROR("9500", "FROZEN_SETTLEMENT_ERROR", "冻结账单失败"),
    FROZEN_SETTLEMENT_ERROR_WITHDRAWAL_IS_NOT_ALLOWED("9501", "FROZEN_SETTLEMENT_ERROR_WITHDRAWAL_IS_NOT_ALLOWED", "冻结账单失败，暂不允许提现"),

    WITHDRAWAL_DISALLOWED("9502", "Withdrawal is not permitted due to incorrect balance", "余额不正确，不允许提现"),

    ;



    private String code;
    private String msg;
    private String displayMsg;

    ResultCodeEnum(String code, String msg, String displayMsg) {
        this.code = code;
        this.msg = msg;
        this.displayMsg = displayMsg;
    }

    public String getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public String getDisplayMsg() {
        return displayMsg;
    }

    public void setDisplayMsg(String displayMsg) {
        this.displayMsg = displayMsg;
    }
}
